package com.andy.wan.android.mvp.ui.adapter;

import com.andy.wan.android.R;
import com.andy.wan.android.mvp.bean.ArticleBean;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import androidx.annotation.NonNull;

/**
 * @Author: luofan
 * @CreateDate: 2020/3/17 11:51
 * @Description:
 */
public class HomeAdapter extends BaseQuickAdapter<ArticleBean, BaseViewHolder> {

    public HomeAdapter() {
        super(R.layout.adapter_home);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, ArticleBean item) {
        helper.setText(R.id.tv_name, item.getTitle());
        helper.setText(R.id.tv_time, TimeUtils.getFriendlyTimeSpanByNow(item.getPublishTime()));
    }
}
